
 <!-- Begin Left Column -->
 <div id="leftcolumn">
 
	<div id="customer">
		<?=form_open('customers/save')?>
			<fieldset>
			<span id="last-name">
				<label for="last_name">Last Name</label> </br>
					<?=form_input($flastname,$result->last_name)?>
			</span>
			<span id="first-name">
				<label for="first_name">First Name</label></br>
					<?=form_input($ffirstname,$result->first_name)?>
			</span>
			<span id="middle">
				<label for="middle">Middle Name</label></br>
					<?=form_input($fmiddle,$result->middle)?>
			</span>
			<span id="dob">
				<label for="month">DOB</label></br>
				<?=form_input($fmonth,$result->month).'/'.
					form_input($fday,$result->day).'/'.
					form_input($fyear,$result->year)?>
			</span>
			<span id="gender">
				<label for="gender">Sex</label></br>
					<?=form_dropdown($fgender['name'],$fgender['options'],$fgender['select'])?>
			</span>
			<span id="race">	
				<label for="race">Race</label></br>
					<?=form_dropdown($frace['name'],$frace['options'],$frace['select'])?>
			</span>
			<span id="home-address">	
				<label for="home_address">Residential Address</label></br>
					<?=form_input('home_address',$result->home_address)?>
			</span>
			<span id="city">	
				<label for="home_city">City</label></br>
					<?=form_dropdown($fcity['name'],$fcity['options'],$fcity['select'])?>
			</span>
			<span id="state">	
				<label for="state">State</label></br>
					<?=form_dropdown($fstate['name'],$fstate['options'],$fstate['select'])?>
			</span>
			<span id="zip">
				<label for="zip_code">Zip</label></br>
					<?=form_input($fzip,$result->zip_code)?>
			</span>
			<span id="home-phone">	
				<label for="home_phone">Home Phone</label></br>
					<?=form_input($fphone,$result->home_phone,$fphone['js'])?>
			</span>	
			</fieldset>

			<fieldset>
			<span id="work-name">
				<label for="work_name">Place of Employment</label></br>
					<?=form_input($fworkname,$result->work_name)?>
			</span>
			<span id="work-phone">
				<label for="work_phone">Work Phone</label></br>
					<?=form_input($fworkphone,$result->work_phone,$fworkphone['js']).br()?>
			</span>
			</fieldset>

			<fieldset>
			<span id="photo-id">
				<label for="photo_id_number">Photo ID Number</label></br>
					<?=form_input($fphotoidnumber,$result->photo_id_number)?>
			</span>
			<span id="id-type">
				<label for="photo_id_type">ID Type</label></br>
					<?=form_dropdown($fphotoidtype['name'],$fphotoidtype['options'],$fphotoidtype['select'])?>
			</span>
			<span id="id-state">
				<label for="photo_id_state">Agency/State</label></br>
					<?=form_input($fphotoidstate,$result->photo_id_state)?>
			</span>
			<span id="height">
				<label for="height">Height</label></br>
					<?=form_input($fheight,$result->height)?>
			</span>
			<span id="weight">
				<label for="weight">Weight</label></br>
					<?=form_input($fweight,$result->weight)?>
			</span>
			<span id="eye-color">
				<label for="eye_color">Eye Color</label></br>
					<?=form_dropdown($feyecolor['name'],$feyecolor['options'],$feyecolor['select'])?>
			</span>
			<span id="hair-color">
				<label for="hair_color">Hair Color</label></br>
					<?=form_dropdown($fhaircolor['name'],$fhaircolor['options'],$fhaircolor['select'])?>
			</span>
			<span id="notes">
				<label for="customer_note">Notes</label></br>
					<?=form_textarea($fnote,$result->customer_note)?>
			</span>
				<?=form_hidden('customer_id',$result->customer_id)?>
			</fieldset>
			<fieldset>
			<span id="button">
				<input type="submit" value="Update" name="Update"<br />
			</span>
			</fieldset>
		</form>
				
		
	</div> 
	<!-- End Customer Div -->
	<div id="pawns">
		<h2>Pawns</h2>	
		<table>
			<thead>
		   		<tr>
		    		<th>Pawn Number</th>
		    		<th>Date</th>
		    		<th>Pawn Amount</th>
		    		<th>Monthly Interest</th>
		    		<th>Total Months</th>
		    		<th>Accrued Interest</th>
		    		<th>Interest Paid</th>
		    		<th>Principal Paid</th>
		    		<th>Amount due to Redeem</th>
		    		<th>Add Payment</th>
		   		</tr>
			</thead>
			<tbody>	
				<?php foreach ($pawn_result as $row): ?>
				<tr>
					<td><?=anchor('pawns/show/'.$row['pawn_id'],$row['pawn_control_number']) ?></td>
					<td><?=date('m/d/Y',mysql_to_unix($row['pawn_date'])) ?></td>
               <td><?=$row['pawn_amount_financed'] ?></td>
               <td><?=$row['finance_charge'] ?></td> <!--Monthly interest -->
               <td><?=$row['total_months'] ?></td>
               <td><?=$row['accrued_interest'] ?></td>
               <td><?=$row['paid_interest'] ?></td>
               <td><?=$row['paid_principal'] ?></td>
               <td><?=$row['total_due'] ?></td>
               <td><?=anchor('payments/add/'.$row['pawn_id'],'Add') ?></td>
				</tr>
				<?php endforeach; ?>
			</tbody>
		</table>
	</div>
	
	<!-- End Pawn Div -->

 </div>
 <!-- End Left Column -->

 
 <!-- Begin Right Column -->
 <div id="rightcolumn">
       
    <ul>
		<li><?php echo anchor('customers/show','Back to main page'); ?></li>
		<li><?php echo anchor('pawns/add/'.$result->customer_id,'Add Pawn'); ?></li>
	</ul>
		 
 </div>
 <!-- End Right Column -->
